home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Macintosh Sample Code / SC.013.OOPTESample / TESample.r < prev    next >
Encoding:
Text File  |  1989-09-30  |  6.0 KB  |  272 lines  |  [TEXT/MPS ]

  1. /*---------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple TextEdit Sample Application
  6. #
  7. #    OOPTESample
  8. #
  9. #    TESample.r        -    Resource Source
  10. #
  11. #    Copyright © 1988, 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Version:        
  15. #                    1.10                    10/89
  16. #                    1.00                    04/89
  17. #
  18. #    Components:     
  19. #                    BuildOOPTESample        October 1, 1989
  20. #                    MOOPTESample.p            October 1, 1989
  21. #                    OOPTESample.make        October 1, 1989
  22. #                    TECommon.h                October 1, 1989
  23. #                    TESampleGlue.a            October 1, 1989
  24. #                    TESample.r                October 1, 1989
  25. #                    UApplication.p            October 1, 1989
  26. #                    UApplication.inc1.p        October 1, 1989
  27. #                    UDocument.p                October 1, 1989
  28. #                    UDocument.inc1.p        October 1, 1989
  29. #                    UTEDocument.p            October 1, 1989
  30. #                    UTEDocument.inc1.p        October 1, 1989
  31. #                    UTESample.p                October 1, 1989
  32. #                    UTESample.inc1.p        October 1, 1989
  33. #
  34. ---------------------------------------------------------------------*/
  35.  
  36. #include "SysTypes.r"
  37. #include "Types.r"
  38.  
  39. #include "TECommon.h"
  40.  
  41. resource 'vers' (1) {
  42.     0x01, 0x10, release, 0x00,
  43.     verUS,
  44.     "1.10",
  45.     "1.10, Copyright © 1988 Apple Computer, Inc."
  46. };
  47.  
  48. /* we use an MBAR resource to conveniently load all the menus */
  49.  
  50. resource 'MBAR' (rMenuBar, preload) {
  51.     { mApple, mFile, mEdit };        /* three menus */
  52. };
  53.  
  54.  
  55. resource 'MENU' (mApple, preload) {
  56.     mApple, textMenuProc,
  57.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  58.     enabled, apple,
  59.     {
  60.         "About OOPTESample…",
  61.             noicon, nokey, nomark, plain;
  62.         "-",
  63.             noicon, nokey, nomark, plain
  64.     }
  65. };
  66.  
  67. resource 'MENU' (mFile, preload) {
  68.     mFile, textMenuProc,
  69.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  70.     enabled, "File",
  71.     {
  72.         "New",
  73.             noicon, "N", nomark, plain;
  74.         "Open",
  75.             noicon, "O", nomark, plain;
  76.         "-",
  77.             noicon, nokey, nomark, plain;
  78.         "Close",
  79.             noicon, "W", nomark, plain;
  80.         "Save",
  81.             noicon, "S", nomark, plain;
  82.         "Save As…",
  83.             noicon, nokey, nomark, plain;
  84.         "Revert",
  85.             noicon, nokey, nomark, plain;
  86.         "-",
  87.             noicon, nokey, nomark, plain;
  88.         "Page Setup…",
  89.             noicon, nokey, nomark, plain;
  90.         "Print…",
  91.             noicon, nokey, nomark, plain;
  92.         "-",
  93.             noicon, nokey, nomark, plain;
  94.         "Quit",
  95.             noicon, "Q", nomark, plain
  96.     }
  97. };
  98.  
  99. resource 'MENU' (mEdit, preload) {
  100.     mEdit, textMenuProc,
  101.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  102.     enabled, "Edit",
  103.      {
  104.         "Undo",
  105.             noicon, "Z", nomark, plain;
  106.         "-",
  107.             noicon, nokey, nomark, plain;
  108.         "Cut",
  109.             noicon, "X", nomark, plain;
  110.         "Copy",
  111.             noicon, "C", nomark, plain;
  112.         "Paste",
  113.             noicon, "V", nomark, plain;
  114.         "Clear",
  115.             noicon, nokey, nomark, plain
  116.     }
  117. };
  118.  
  119.  
  120. /* this ALRT and DITL are used as an About screen */
  121.  
  122. resource 'ALRT' (rAboutAlert, purgeable) {
  123.     {40, 20, 160, 330 }, rAboutAlert, {
  124.         OK, visible, silent;
  125.         OK, visible, silent;
  126.         OK, visible, silent;
  127.         OK, visible, silent
  128.     };
  129. };
  130.  
  131. resource 'DITL' (rAboutAlert, purgeable) {
  132.     { /* array DITLarray: 5 elements */
  133.         /* [1] */
  134.         {88, 224, 108, 304},
  135.         Button {
  136.             enabled,
  137.             "OK"
  138.         },
  139.         /* [2] */
  140.         {8, 8, 24, 304 },
  141.         StaticText {
  142.             disabled,
  143.             "MultiFinder-Aware Object Pascal Application"
  144.         },
  145.         /* [3] */
  146.         {32, 8, 48, 237},
  147.         StaticText {
  148.             disabled,
  149.             "Copyright © 1988 Apple Computer"
  150.         },
  151.         /* [4] */
  152.         {56, 8, 72, 136},
  153.         StaticText {
  154.             disabled,
  155.             "Brought to you by:"
  156.         },
  157.         /* [5] */
  158.         {80, 24, 112, 167},
  159.         StaticText {
  160.             disabled,
  161.             "Macintosh Developer  Technical Support"
  162.         }
  163.     }
  164. };
  165.  
  166.  
  167. resource 'WIND' (rDocWindow, preload, purgeable) {
  168.     {64, 60, 314, 460},
  169.     zoomDocProc, invisible, goAway, 0x0, "untitled"
  170. };
  171.  
  172.  
  173. resource 'CNTL' (rVScroll, preload, purgeable) {
  174.     {-1, 385, 236, 401},
  175.     0, visible, 0, 0, scrollBarProc, 0, ""
  176. };
  177.  
  178.  
  179. resource 'CNTL' (rHScroll, preload, purgeable) {
  180.     {235, -1, 251, 386},
  181.     0, visible, 0, 0, scrollBarProc, 0, ""
  182. };
  183.  
  184. resource 'STR#' (kTEDocErrStrings, purgeable) {
  185.     {
  186.     "Not enough memory to run TESample";
  187.     "Not enough memory to do Cut";
  188.     "Cannot do Cut";
  189.     "Cannot do Copy";
  190.     "Cannot exceed 32,000 characters with Paste";
  191.     "Not enough memory to do Paste";
  192.     "Cannot create window";
  193.     "Cannot exceed 32,000 characters";
  194.     "Cannot do Paste"
  195.     }
  196. };
  197.  
  198. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  199.  
  200. resource 'SIZE' (-1) {
  201.     dontSaveScreen,
  202.     acceptSuspendResumeEvents,
  203.     enableOptionSwitch,
  204.     canBackground,        /* we can background; we don't currently, but our sleep value */
  205.                         /* guarantees we don't hog the Mac while we are in the background */
  206.     multiFinderAware,    /* this says we do our own activate/deactivate; don't fake us out */
  207.     backgroundAndForeground, /* this is definitely note a background-only application! */
  208.     dontGetFrontClicks,    /* change this is if you want "do first click" behavior like the Finder */
  209.     ignoreChildDiedEvents,
  210.     is32BitCompatible,
  211.     reserved, reserved, reserved, reserved,
  212.     reserved, reserved, reserved,
  213.     kPrefSize * 1024,
  214.     kMinSize * 1024
  215. };
  216.  
  217.  
  218. type 'MOOT' as 'STR ';
  219.  
  220.  
  221. resource 'MOOT' (0) {
  222.     "MultiFinder-Aware TextEdit Sample Application"
  223. };
  224.  
  225.  
  226. resource 'BNDL' (128) {
  227.     'MOOT',
  228.     0,
  229.     {
  230.         'ICN#',
  231.         {
  232.             0, 128
  233.         },
  234.         'FREF',
  235.         {
  236.             0, 128
  237.         }
  238.     }
  239. };
  240.  
  241.  
  242. resource 'FREF' (128) {
  243.     'APPL',
  244.     0,
  245.     ""
  246. };
  247.  
  248.  
  249. resource 'ICN#' (128) {
  250.     { /* array: 2 elements */
  251.         /* [1] */
  252.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  253.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  254.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  255.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  256.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  257.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  258.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  259.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  260.         /* [2] */
  261.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  262.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  263.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  264.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  265.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  266.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  267.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  268.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  269.     }
  270. };
  271.  
  272.